from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from time import sleep

url=r'https://www.baidu.com/'

#方式1：默认参数
# driver=webdriver.Chrome()

#方式2 ：指定参数
chrome_location = r'D:\测试工具\Win_x64_1135105_chrome-win\chrome-win\chrome.exe'
options = webdriver.ChromeOptions()
options.binary_location = chrome_location
# driver = webdriver.Chrome(test_cases_webtours=test_cases_webtours)
# 2、方式3：指定 Chromedriver 驱动位置：service 参数 (注意驱动程序如果放置到了python安装目录下，可以不使用service参数）
driver_location = r'D:\测试工具\pythan\chromedriver.exe'
service = Service(driver_location)
driver = webdriver.Chrome(options=options, service=service)

driver.get(url)
sleep(3)


driver.quit()